<!DOCTYPE html>
<html lang="zh_cn">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="/webjars/bootstrap/3.4.1/css/bootstrap.css">
</head>
<style>
    body {
        padding-top: 70px;
    }

    .media-object {
        width: 128px;
        height: 128px;
        background-color: #cccccc;
    }
</style>
<body>
<#include "common/header.ftl" >

<div class="container">
    <div class="row">
        <div class="col-md-9">
            <@g_article bId="${aId}">
                <div>
                    <h2>${article.title}
                        <small>${article.createTime}</small>
                    </h2>
                    <p>${article.content}</p>
                </div>
                <#if article.commentary == 1>
                    <#include "common/commentaryEdit.ftl" >
                </#if>
            </@g_article>
            <#include "common/commentary.ftl" >
        </div>
        <div class="col-md-3">
            <h1>广告位招租</h1>
            <#include "common/sider.ftl" >
        </div>
    </div>
</div>

<script src="/webjars/jquery/3.4.1/jquery.js"></script>
<script src="/webjars/bootstrap/3.4.1/js/bootstrap.js"></script>
<script>

    function commentary() {
        var content = {
            aId: '${aId}',
            content: $("#content").val()
        }
        $.ajax({
            url: "/blog/commentary/create",
            type: 'post',
            async: true,
            contentType: "application/json;charset=utf-8",
            data: {
                "comment": content
            },
            dataType: "json",
            success: function (result) {
                // if (response.data.code == 200) {
                //     alert("评论发布成功");
                // } else {
                //     alert("评论发布失败");
                // }
            }
        })
    }
</script>
</body>
</html>